package com.redhat.redwork.widget;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.UIBean;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;

import com.opensymphony.xwork2.util.ValueStack;

@StrutsTag(name = "topicBridge", tldTagClass = "com.redhat.redwork.widget.TopicBridgeTag", description = "well.. the topic bridge")
public class Submit extends UIBean{

	public static final String TEMPLATE = "submit";
	
	protected String binding;
	
	public Submit(ValueStack stack, HttpServletRequest request,
			HttpServletResponse response) {
		super(stack, request, response);
	}
	
	@Override
	protected String getDefaultTemplate() {
		return TEMPLATE;
	}

	@Override
	protected void evaluateExtraParams() {
		super.evaluateExtraParams();
		
		addParameter("binding", findString(binding));
	}

	@StrutsTagAttribute(description = "binding element for submit")
	public void setBinding(String binding) {
		this.binding = binding;
	}
	
}
